# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=subtitlecomposer
pkgver=0.7.1
pkgrel=4
# armhf blocked by extra-cmake-modules
# s390x, armv7, riscv64 and aarch64 blocked by OpenGLES
arch="all !armhf !s390x !armv7 !aarch64 !riscv64"
url="https://subtitlecomposer.kde.org/"
pkgdesc="The open source text-based subtitle editor"
license="GPL-2.0-only"
makedepends="
	extra-cmake-modules
	ffmpeg-dev
	kauth-dev
	kcodecs-dev
	kconfig-dev
	kconfigwidgets-dev
	kcoreaddons-dev
	ki18n-dev
	kio-dev
	kross-dev
	ktextwidgets-dev
	kwidgetsaddons-dev
	kxmlgui-dev
	openal-soft-dev
	qt5-qtbase-dev
	samurai
	sonnet-dev
	"
checkdepends="xvfb-run"
source="https://download.kde.org/stable/subtitlecomposer/subtitlecomposer-$pkgver.tar.xz
	ffmpeg5.patch
	"
subpackages="$pkgname-lang"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	cd build
	CTEST_OUTPUT_ON_FAILURE=TRUE xvfb-run ctest
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
b486a1be8b414409af4ec2d2ccc86a7e9f34040f114b0efbbf817b5157d85b5f9a37d80272b468a389128f10c12316bf028dd86e2a7434a2b001bfd185208b92  subtitlecomposer-0.7.1.tar.xz
1b6b93e9e5bf00c8291b2de7365b217d62d7d453f4e949dc042960a3258483049959525dd8891ed0fd8f8954afefccf325137de063122ac2d1cc506f248cd885  ffmpeg5.patch
"
